<%--
  Created by IntelliJ IDEA.
  User: 57998
  Date: 2020/10/17
  Time: 16:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/classify_copy.css" />
		<link rel="stylesheet" type="text/css" href="css/qiantai_home_copy.css" />
		<link rel="stylesheet" type="text/css" href="css/channel_base.css" />
		<link rel="stylesheet" type="text/css" href="css/mine.css" />
		<script type="text/javascript" src="js/jquery-2.2.0.min.js"></script>
		<script type="text/javascript" src="js/mine.js"></script>
		<title>我的</title>
	</head>
	<body>

		<%@ include file="top.jsp"%>
		<div class="main">
			<link rel='stylesheet' href="css/qiantai_mine_copy.css" type='text/css' media='all' />
			<div class="container container-user">
				<div class="userside">
					<div class="usertitle" style="margin-top: 10%;">
						<a href="#" class="edit-avatar"><img src="images/qiantai/userimg.png" class="avatar avatar-50 photo" width="50"
							 height="50" /></a>
						<c:forEach var="U" items="${userinfo}">
							<h2>${U.name}</h2>
							<h2 style="color: red;margin-top: 10%;">${U.vip_temp}</h2>
							<c:choose>
								<c:when test="${U.end_time_temp eq '0'}">
									<h2 onclick="add_vip()" style="font-size: 17px;margin-top: 10%;background-image: linear-gradient(90deg,blueviolet 0,blue 54%,skyblue 100%);
									color: #fff !important;border-radius: 15px;padding: 3px 12px;display: inline-block;cursor:pointer">升级会员</h2>
								</c:when>
								<c:otherwise>
									<h2 style="font-size: 15px;margin-top: 10%;color: blueviolet;">到期时间：${U.end_time_temp}</h2>
								</c:otherwise>
							</c:choose>
						</c:forEach>
					</div>
					<div class="usermenus">
						<ul class="usermenu">
							<li class="usermenu-vip "><a href="#" onclick="show_tuijian()" id="left_tuijian">个性推荐</a></li>
							<li class="usermenu-vip "><a href="#" onclick="show_lishi()" id="left_lishi">我的历史</a></li>
							<li class="usermenu-user "><a href="#" onclick="show_change_mine()" id="left_change_mine">修改资料</a></li>
							<li class="usermenu-signout"><a href="${pageContext.request.contextPath}/quit">安全退出</a></li>
						</ul>
					</div>
				</div>
				<div class="content" style="height: 500px;display: flex;justify-content: center;">
					<div class="user-main">
						<div class="charge vip" id="tuijian">
							<div class="mod_bd cf ">
								<div class="mod_figure_1fps2r ">
									<div class="">
										<h2 style="text-align: center;font-size: 20px;color: maroon;margin-bottom: 5%;">个性推荐</h2>
										<c:choose>
											<c:when test="${like eq '0'}">
												<h2>请先观看至少4部影片，才可根据您的兴趣进行个性推荐！</h2>
											</c:when>
											<c:otherwise>
												<div class="mod_figure mod_figure_h_default mod_figure_h_default_2row mod_figure_h_default" style="display: flex;justify-content: center;flex-wrap: wrap;">
													<c:forEach var="U" items="${likefilms1}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms2}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms3}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms5}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms6}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms8}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms9}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
													<c:forEach var="U" items="${likefilms10}">
														<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
															<a href="#" class="figure">
																<img class="figure_pic" src="${U.img}">
																<div class="figure_score">${U.vip_look_temp}</div>
															</a>
															<div class="figure_detail figure_detail_two_row">
																<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
																<div class="figure_desc">${U.content}</div>
															</div>
														</div>
													</c:forEach>
												</div>
											</c:otherwise>
										</c:choose>
									</div>
								</div>
							</div>
						</div>
						<div class="charge vip" id="lishi" hidden="hidden">
							<div class="mod_bd cf ">
								<div class="mod_figure_1fps2r ">
									<div class="">
										<h2 style="text-align: center;font-size: 20px;color: maroon;margin-bottom: 5%;">历史观看</h2>
										<div class="mod_figure mod_figure_h_default mod_figure_h_default_2row mod_figure_h_default" style="display: flex;justify-content: center;flex-wrap: wrap;">
											<c:forEach var="U" items="${myfilms}" begin="0" end="7">
												<div class="list_item" onclick="update_fid1('${U.id}','${U.vedio}','${U.vip_look_temp}')">
													<a href="#" class="figure">
														<img class="figure_pic" src="${U.img}">
														<div class="figure_score">${U.vip_look_temp}</div>
													</a>
													<div class="figure_detail figure_detail_two_row">
														<a href="#" class="figure_title figure_title_two_row bold">${U.name}</a>
														<div class="figure_desc">${U.content}</div>
													</div>
												</div>
											</c:forEach>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="user-main" id="change_mine" hidden="hidden">
							<h2 style="text-align: center;font-size: 20px;color: maroon;margin-bottom: 5%;">修改资料</h2>
							<form style="margin-bottom: 30px" action="${pageContext.request.contextPath}/updateuserinfo" method="post"
							 enctype="multipart/form-data" onsubmit="return check()">
								<c:forEach var="U" items="${userinfo}">
									<input type="hidden" name="id" value="${U.id}" />
									<input type="hidden" name="fid1" value="${U.fid1}" />
									<input type="hidden" name="fid2" value="${U.fid2}" />
									<input type="hidden" name="fid3" value="${U.fid3}" />
									<input type="hidden" name="fid4" value="${U.fid4}" />
									<ul class="user-meta">
										<li>
											<label>用户名</label>
											<input type="input" class="form-control" id="name" name="name" value="${U.name}">
										</li>
										<li>
											<label>密码</label>
											<input type="input" class="form-control" id="password" name="password" value="${U.password}">
										</li>
										<li>
											<label>邮箱</label>
											<input type="email" class="form-control" id="email" name="email" value="${U.email}">
										</li>
										<li>
											<input type="submit" style="background-color: #1d1d1d;border-color: #1d1d1d;
										background: #1d1d1d;color: #fff;border-radius: 2px;padding: 8px 25px;
										text-align: center;border: none;"
											 value="确认修改">
										</li>
									</ul>
								</c:forEach>
							</form>
							<div class="user-alerts">
								<h4>注意事项：</h4>
								<ul>
									<li>请务必修改成你正确的邮箱地址，以便于忘记密码时用来重置密码。</li>
									<li>获取验证码时，邮件发送时间有时会稍长，请您耐心等待。</li>
								</ul>
							</div>
						</div>
					</div>
					<div class="user-tips"></div>
				</div>
			</div>
		</div>

		<script type="text/javascript">
			window.onload = function() {
				if ($("#login").val() != "nologin") {
					$("#nologin").hide();
					$("#islogin").show();
				} else {
					$("#nologin").show();
					$("#islogin").hide();
				}
				$("#left_tuijian").addClass("active");
			}

			function add_vip() {
				parent.layer.msg('请添加管理员QQ操作!', {
					time: 1500,
					offset: "35%",
				});
			}

			function check() {
				if($("#name").val() == "" || $("#email").val() == "" || $("#password").val() == ""){
					layer.msg('请将信息完整输入!', {
						time: 1500
					});
					return false;
				}else{
					return true;
				}
			}
		</script>

	</body>
</html>
